import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'

Vue.use(VueRouter)

  const routes: Array<RouteConfig> = [
  {
    path:'/',component:()=>import('../views/Login.vue')
  },
  {
    path: '/content',
    component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
    children:[
      { path:'/',component:()=>import('../views/echarts/index.vue')},

      { path:'/contentlist',component:()=>import('../views/content/contentList.vue')},
      { path:'/contentedit',component:()=>import('../views/content/contentEdit.vue')},
      { path:'/contentedit/:id',component:()=>import('../views/content/contentEdit.vue'),props:true },

      { path:'/typelist',component:()=>import('../views/types/typelist.vue')},
      { path:'/typeedit',component:()=>import('../views/types/typeedit.vue')},
      { path:'/typeedit/:id',component:()=>import('../views/types/typeedit.vue'),props:true }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
